package edu.gatech.cc.hwa.server.database;

public class Statements {

	public static String DATABASE_NAME = "test";
	public static String HISTORY_ENTRY_TABLE_NAME = DATABASE_NAME+".HistoryEntry";
	public static String PROFILE_TABLE_NAME = DATABASE_NAME+".Profile";
	public static String USER_TABLE_NAME = DATABASE_NAME+".User";
	
	protected static final String INSERT_HISTORY_ENTRY = 
		"INSERT INTO "
			+HISTORY_ENTRY_TABLE_NAME
		+" (PID, SequenceNumber, Browser, DayOfWeek, IpAddress, OperatingSystem, TimeToTypePassword, TimeOfDay) "
		+" VALUES "
		+" (?, ?, ?, ?, ?, ?, ?, ?)";  
	
	protected static final String INSERT_PROFILE = 
		"INSERT INTO "
			+PROFILE_TABLE_NAME
		+" (UID) "
		+" VALUES "
		+" (?)";  
	
	protected static final String INSERT_USER = 
		"INSERT INTO "
			+USER_TABLE_NAME
		+" (UName, Pswd_Hash) "
		+" VALUES "
		+" (?,?)"; 
	
	protected static final String SELECT_USER_BY_NAME = 
		"SELECT "
			+" UID"
			+", Pswd_Hash"
		+" FROM "
			+USER_TABLE_NAME
		+" WHERE " 
			+"UName=?"; 
	
	protected static final String SELECT_USER_PROFILES = 
		"SELECT "
		+ " PID"
		+ ", Browser"
		+ ", DayOfWeek"
		+ ", IpAddress"
		+ ", OperatingSystem"
		+ ", TimeToTypePassword"
		+ ", TimeOfDay"
		+ " FROM "
			+ PROFILE_TABLE_NAME
		+" WHERE "
			+" UID=?"; 
	
	protected static final String SELECT_HISTORY_ENTRIES = 
		"SELECT "
			+ ", Entry_ID"
			+ ", SequenceNumber"
			+ ", Browser"
			+ ", DayOfWeek"
			+ ", IpAddress"
			+ ", OperatingSystem"
			+ ", TimeToTypePassword"
			+ ", TimeOfDay"
		+ " FROM "
			+ HISTORY_ENTRY_TABLE_NAME
		+ " WHERE "
			+ "PID=?"; 
	
	protected static final String UPDATE_HISTORY_ENTRY = 
		"UPDATE "
			+ HISTORY_ENTRY_TABLE_NAME
		+ " SET "
			+ "SequenceNumber=?"
			+ ", Browser=?"
			+ ", DayOfWeek=?"
			+ ", IpAddress=?"
			+ ", OperatingSystem=?"
			+ ", TimeToTypePassword=?"
			+ ", TimeOfDay=?"
		+ " WHERE "
			+ " Entry_ID=?";

	protected static final String UPDATE_PROFILE = 
		"UPDATE "
			+ PROFILE_TABLE_NAME
		+ " SET "
			+ "Browser=?"
			+ ", DayOfWeek=?"
			+ ", IpAddress=?"
			+ ", OperatingSystem=?"
			+ ", TimeToTypePassword=?"
			+ ", TimeOfDay=?"
		+ " WHERE "
			+ " PID=?";
}
